package com.woniu.mall.feign;

import com.woniu.common.annotation.LoginUser;
import com.woniu.common.entity.Result;
import com.woniu.mall.pojo.MallSeckill;
import com.woniu.user.vo.UserLoginVO;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "life-mall", path = "/mallSeckill", contextId = "seckill")
public interface SeckillFeignClient {

    @ApiOperation("单线程秒杀")
    @GetMapping("/create/{productId}")
    public Result seckill(@PathVariable(value = "productId") Integer productId, @LoginUser UserLoginVO userLoginVO);

    @ApiOperation("获取秒杀商品")
    @GetMapping("/listSeckill")
    public Result<List<MallSeckill>> listStarting();
}
